home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / bsd / ufs / fs.h next >
C/C++ Source or Header  |  1995-02-14  |  18KB  |  484 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1987 Carnegie-Mellon University
  4.  * All rights reserved.  The CMU software License Agreement specifies
  5.  * the terms and conditions for use and redistribution.
  6.  */
  7. /*
  8.  * HISTORY
  9.  * 27-Sep-89  Morris Meyer (mmeyer) at NeXT
  10.  *    NFS 4.0 Changes.
  11.  *
  12.  * 25-Jan-86  Avadis Tevanian (avie) at Carnegie-Mellon University
  13.  *    Upgraded to 4.3.
  14.  *
  15.  * 03-Aug-85  Mike Accetta (mja) at Carnegie-Mellon University
  16.  *    CS_RPAUSE:  Added freefrags() and freeinodes() macros and
  17.  *    FS_FLOWAT, FS_FHIWAT, FS_ILOWAT, FS_IHIWAT, FS_FNOSPC and
  18.  *    FS_INOSPC definitions.
  19.  *
  20.  */
  21.  
  22. /*
  23.  * Copyright (c) 1982, 1986 Regents of the University of California.
  24.  * All rights reserved.  The Berkeley software License Agreement
  25.  * specifies the terms and conditions for redistribution.
  26.  *
  27.  *    @(#)fs.h    7.1 (Berkeley) 6/4/86
  28.  */
  29.  
  30. /*    @(#)fs.h    2.1 88/05/20 4.0NFSSRC SMI;    from UCB 7.1 6/4/86    */
  31.  
  32. /*
  33.  * Each disk drive contains some number of file systems.
  34.  * A file system consists of a number of cylinder groups.
  35.  * Each cylinder group has inodes and data.
  36.  *
  37.  * A file system is described by its super-block, which in turn
  38.  * describes the cylinder groups.  The super-block is critical
  39.  * data and is replicated in each cylinder group to protect against
  40.  * catastrophic loss.  This is done at mkfs time and the critical
  41.  * super-block data does not change, so the copies need not be
  42.  * referenced further unless disaster strikes.
  43.  *
  44.  * For file system fs, the offsets of the various blocks of interest
  45.  * are given in the super block as:
  46.  *    [fs->fs_sblkno]        Super-block
  47.  *    [fs->fs_cblkno]        Cylinder group block
  48.  *    [fs->fs_iblkno]        Inode blocks
  49.  *    [fs->fs_dblkno]        Data blocks
  50.  * The beginning of cylinder group cg in fs, is given by
  51.  * the ``cgbase(fs, cg)'' macro.
  52.  *
  53.  * The first boot and super blocks are given in absolute disk addresses.
  54.  */
  55. #define BBSIZE        8192
  56. #define SBSIZE        8192
  57. #define    BBLOCK        ((daddr_t)(0))
  58. #if    NeXT
  59. /*
  60.  *  SBLOCK gives the address in bytes.  It's up to code to convert to
  61.  *  device blocks based on the blocksize of the device...
  62.  */
  63. #define    SBLOCK        ((daddr_t)(BBLOCK + BBSIZE))
  64. #else    NeXT
  65. #define    SBLOCK        ((daddr_t)(BBLOCK + BBSIZE) / DEV_BSIZE)
  66. #endif    NeXT
  67.  
  68. /*
  69.  * Addresses stored in inodes are capable of addressing fragments
  70.  * of `blocks'. File system blocks of at most size MAXBSIZE can 
  71.  * be optionally broken into 2, 4, or 8 pieces, each of which is
  72.  * addressible; these pieces may be DEV_BSIZE, or some multiple of
  73.  * a DEV_BSIZE unit.
  74.  *
  75.  * Large files consist of exclusively large data blocks.  To avoid
  76.  * undue wasted disk space, the last data block of a small file may be
  77.  * allocated as only as many fragments of a large block as are
  78.  * necessary.  The file system format retains only a single pointer
  79.  * to such a fragment, which is a piece of a single large block that
  80.  * has been divided.  The size of such a fragment is determinable from
  81.  * information in the inode, using the ``blksize(fs, ip, lbn)'' macro.
  82.  *
  83.  * The file system records space availability at the fragment level;
  84.  * to determine block availability, aligned fragments are examined.
  85.  *
  86.  * The root inode is the root of the file system.
  87.  * Inode 0 can't be used for normal purposes and
  88.  * historically bad blocks were linked to inode 1,
  89.  * thus the root inode is 2. (inode 1 is no longer used for
  90.  * this purpose, however numerous dump tapes make this
  91.  * assumption, so we are stuck with it)
  92.  * The lost+found directory is given the next available
  93.  * inode when it is created by ``mkfs''.
  94.  */
  95. #define    ROOTINO        ((ino_t)2)    /* i number of all roots */
  96. #define LOSTFOUNDINO    (ROOTINO + 1)
  97.  
  98. /*
  99.  * Cylinder group related limits.
  100.  *
  101.  * For each cylinder we keep track of the availability of blocks at different
  102.  * rotational positions, so that we can lay out the data to be picked
  103.  * up with minimum rotational latency.  NRPOS is the number of rotational
  104.  * positions which we distinguish.  With NRPOS 8 the resolution of our
  105.  * summary information is 2ms for a typical 3600 rpm drive.
  106.  */
  107. #define    NRPOS        8    /* number distinct rotational positions */
  108.  
  109. /*
  110.  * MAXIPG bounds the number of inodes per cylinder group, and
  111.  * is needed only to keep the structure simpler by having the
  112.  * only a single variable size element (the free bit map).
  113.  *
  114.  * N.B.: MAXIPG must be a multiple of INOPB(fs).
  115.  */
  116. #define    MAXIPG        2048    /* max number inodes/cyl group */
  117.  
  118. /*
  119.  * MINBSIZE is the smallest allowable block size.
  120.  * In order to insure that it is possible to create files of size
  121.  * 2^32 with only two levels of indirection, MINBSIZE is set to 4096.
  122.  * MINBSIZE must be big enough to hold a cylinder group block,
  123.  * thus changes to (struct cg) must keep its size within MINBSIZE.
  124.  * MAXCPG is limited only to dimension an array in (struct cg);
  125.  * it can be made larger as long as that structures size remains
  126.  * within the bounds dictated by MINBSIZE.
  127.  * Note that super blocks are always of size SBSIZE,
  128.  * and that both SBSIZE and MAXBSIZE must be >= MINBSIZE.
  129.  */
  130. #define MINBSIZE    4096
  131. #define    MAXCPG        32    /* maximum fs_cpg */
  132.  
  133. /*
  134.  * The path name on which the file system is mounted is maintained
  135.  * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in 
  136.  * the super block for this name.
  137.  * The limit on the amount of summary information per file system
  138.  * is defined by MAXCSBUFS. It is currently parameterized for a
  139.  * maximum of two million cylinders.
  140.  */
  141. #define MAXMNTLEN 512
  142. #define MAXCSBUFS 32
  143.  
  144. /*
  145.  * Per cylinder group information; summarized in blocks allocated
  146.  * from first cylinder group data blocks.  These blocks have to be
  147.  * read in from fs_csaddr (size fs_cssize) in addition to the
  148.  * super block.
  149.  *
  150.  * N.B. sizeof(struct csum) must be a power of two in order for
  151.  * the ``fs_cs'' macro to work (see below).
  152.  */
  153. struct csum {
  154.     long    cs_ndir;    /* number of directories */
  155.     long    cs_nbfree;    /* number of free blocks */
  156.     long    cs_nifree;    /* number of free inodes */
  157.     long    cs_nffree;    /* number of free frags */
  158. };
  159.  
  160. /*
  161.  * Super block for a file system.
  162.  */
  163. #define    FS_MAGIC    0x011954
  164. struct    fs
  165. {
  166.     struct    fs *fs_link;        /* linked list of file systems */
  167.     struct    fs *fs_rlink;        /*     used for incore super blocks */
  168.     daddr_t    fs_sblkno;        /* addr of super-block in filesys */
  169.     daddr_t    fs_cblkno;        /* offset of cyl-block in filesys */
  170.     daddr_t    fs_iblkno;        /* offset of inode-blocks in filesys */
  171.     daddr_t    fs_dblkno;        /* offset of first data after cg */
  172.     long    fs_cgoffset;        /* cylinder group offset in cylinder */
  173.     long    fs_cgmask;        /* used to calc mod fs_ntrak */
  174.     time_t     fs_time;            /* last time written */
  175.     long    fs_size;        /* number of blocks in fs */
  176.     long    fs_dsize;        /* number of data blocks in fs */
  177.     long    fs_ncg;            /* number of cylinder groups */
  178.     long    fs_bsize;        /* size of basic blocks in fs */
  179.     long    fs_fsize;        /* size of frag blocks in fs */
  180.     long    fs_frag;        /* number of frags in a block in fs */
  181. /* these are configuration parameters */
  182.     long    fs_minfree;        /* minimum percentage of free blocks */
  183.     long    fs_rotdelay;        /* num of ms for optimal next block */
  184.     long    fs_rps;            /* disk revolutions per second */
  185. /* these fields can be computed from the others */
  186.     long    fs_bmask;        /* ``blkoff'' calc of blk offsets */
  187.     long    fs_fmask;        /* ``fragoff'' calc of frag offsets */
  188.     long    fs_bshift;        /* ``lblkno'' calc of logical blkno */
  189.     long    fs_fshift;        /* ``numfrags'' calc number of frags */
  190. /* these are configuration parameters */
  191.     long    fs_maxcontig;        /* max number of contiguous blks */
  192.     long    fs_maxbpg;        /* max number of blks per cyl group */
  193. /* these fields can be computed from the others */
  194.     long    fs_fragshift;        /* block to frag shift */
  195.     long    fs_fsbtodb;        /* fsbtodb and dbtofsb shift constant */
  196.     long    fs_sbsize;        /* actual size of super block */
  197.     long    fs_csmask;        /* csum block offset */
  198.     long    fs_csshift;        /* csum block number */
  199.     long    fs_nindir;        /* value of NINDIR */
  200.     long    fs_inopb;        /* value of INOPB */
  201.     long    fs_nspf;        /* value of NSPF */
  202.     long    fs_optim;        /* optimization preference, see below */
  203. /* BEGIN CS_RPAUSE */
  204.     /*
  205.      *  This entire structure appears on the disk in new file systems
  206.      *  and the in-core version is the primary handle which is passed
  207.      *  around internally.  We need space for a pointer to the old
  208.      *  format super-block for such file systems and this is as good as
  209.      *  any.  We could also share space with any field used by the new
  210.      *  file system which is not needed in the common path processing
  211.      *  code for both file systems but this seems safer.
  212.      */
  213.     union {
  214.         long   sufs_sparecon[5];    /* reserved for future constants */
  215.     } fs_spareun;
  216. #define    fs_fhiwat fs_spareun.sufs_sparecon[1]    /* fragment high water mark */
  217. #define    fs_flowat fs_spareun.sufs_sparecon[2]    /* fragment low water mark */
  218. #define    fs_ihiwat fs_spareun.sufs_sparecon[3]    /* inode high water mark */
  219. #define    fs_ilowat fs_spareun.sufs_sparecon[4]    /* inode low water mark */
  220. #define    fs_sparecon fs_spareun.sufs_sparecon
  221. /* END CS_RPAUSE */
  222. /* sizes determined by number of cylinder groups and their sizes */
  223.     daddr_t fs_csaddr;        /* blk addr of cyl grp summary area */
  224.     long    fs_cssize;        /* size of cyl grp summary area */
  225.     long    fs_cgsize;        /* cylinder group size */
  226. /* these fields should be derived from the hardware */
  227.     long    fs_ntrak;        /* tracks per cylinder */
  228.     long    fs_nsect;        /* sectors per track */
  229.     long      fs_spc;           /* sectors per cylinder */
  230. /* this comes from the disk driver partitioning */
  231.     long    fs_ncyl;           /* cylinders in file system */
  232. /* these fields can be computed from the others */
  233.     long    fs_cpg;            /* cylinders per group */
  234.     long    fs_ipg;            /* inodes per group */
  235.     long    fs_fpg;            /* blocks per group * fs_frag */
  236. /* this data must be re-computed after crashes */
  237.     struct    csum fs_cstotal;    /* cylinder summary information */
  238. /* these fields are cleared at mount time */
  239.     char       fs_fmod;            /* super block modified flag */
  240. #ifdef    NeXT
  241.     char       fs_state;            /* file system state (clean,...) */
  242. #else    NeXT
  243.     char       fs_clean;            /* super block clean flag */
  244. #endif    NeXT
  245.     char       fs_ronly;           /* mounted read-only flag */
  246.     char       fs_flags;           /* currently unused flag */
  247.     char    fs_fsmnt[MAXMNTLEN];    /* name mounted on */
  248. /* these fields retain the current block allocation info */
  249.     long    fs_cgrotor;        /* last cg searched */
  250.     struct    csum *fs_csp[MAXCSBUFS];/* list of fs_cs info buffers */
  251.     long    fs_cpc;            /* cyl per cycle in postbl */
  252.     short    fs_postbl[MAXCPG][NRPOS];/* head of blocks for each rotation */
  253.     long    fs_magic;        /* magic number */
  254.     u_char    fs_rotbl[1];        /* list of blocks for each rotation */
  255. /* actually longer */
  256. };
  257. /*
  258.  * Preference for optimization.
  259.  */
  260. #define FS_OPTTIME    0    /* minimize allocation time */
  261. #define FS_OPTSPACE    1    /* minimize disk fragmentation */
  262.  
  263. #ifdef    NeXT
  264. /*
  265.  *    File system states.
  266.  *
  267.  *    A cleanly unmounted FS goes to clean state if it was in dirty
  268.  *    state.  Mounting a clean FS makes it dirty.  Mounting a dirty FS
  269.  *    makes it corrupted.  fsck (or equivalent) will change a dirty or
  270.  *    corrupted FS to clean state.  NOTE: a FS that has never had this
  271.  *    state set (state == 0) will be treated as corrupted.
  272.  */
  273.  
  274. #define FS_STATE_CLEAN        1    /* cleanly unmounted */
  275. #define FS_STATE_DIRTY        2    /* dirty */
  276. #define FS_STATE_CORRUPTED    3    /* mounted while dirty */
  277. #endif    NeXT
  278.  
  279. /*
  280.  * Convert cylinder group to base address of its global summary info.
  281.  *
  282.  * N.B. This macro assumes that sizeof(struct csum) is a power of two.
  283.  */
  284. #define fs_cs(fs, indx) \
  285.     fs_csp[(indx) >> (fs)->fs_csshift][(indx) & ~(fs)->fs_csmask]
  286.  
  287. /*
  288.  * MAXBPC bounds the size of the rotational layout tables and
  289.  * is limited by the fact that the super block is of size SBSIZE.
  290.  * The size of these tables is INVERSELY proportional to the block
  291.  * size of the file system. It is aggravated by sector sizes that
  292.  * are not powers of two, as this increases the number of cylinders
  293.  * included before the rotational pattern repeats (fs_cpc).
  294.  * Its size is derived from the number of bytes remaining in (struct fs)
  295.  */
  296. #define    MAXBPC    (SBSIZE - sizeof (struct fs))
  297.  
  298. /*
  299.  * Cylinder group block for a file system.
  300.  */
  301. #define    CG_MAGIC    0x090255
  302. struct    cg {
  303.     struct    cg *cg_link;        /* linked list of cyl groups */
  304.     struct    cg *cg_rlink;        /*     used for incore cyl groups */
  305.     time_t    cg_time;        /* time last written */
  306.     long    cg_cgx;            /* we are the cgx'th cylinder group */
  307.     short    cg_ncyl;        /* number of cyl's this cg */
  308.     short    cg_niblk;        /* number of inode blocks this cg */
  309.     long    cg_ndblk;        /* number of data blocks this cg */
  310.     struct    csum cg_cs;        /* cylinder summary information */
  311.     long    cg_rotor;        /* position of last used block */
  312.     long    cg_frotor;        /* position of last used frag */
  313.     long    cg_irotor;        /* position of last used inode */
  314.     long    cg_frsum[MAXFRAG];    /* counts of available frags */
  315.     long    cg_btot[MAXCPG];    /* block totals per cylinder */
  316.     short    cg_b[MAXCPG][NRPOS];    /* positions of free blocks */
  317.     char    cg_iused[MAXIPG/NBBY];    /* used inode map */
  318.     long    cg_magic;        /* magic number */
  319.     u_char    cg_free[1];        /* free block map */
  320. /* actually longer */
  321. };
  322.  
  323. /*
  324.  * MAXBPG bounds the number of blocks of data per cylinder group,
  325.  * and is limited by the fact that cylinder groups are at most one block.
  326.  * Its size is derived from the size of blocks and the (struct cg) size,
  327.  * by the number of remaining bits.
  328.  */
  329. #define    MAXBPG(fs) \
  330.     (fragstoblks((fs), (NBBY * ((fs)->fs_bsize - (sizeof (struct cg))))))
  331.  
  332. /*
  333.  * Turn file system block numbers into disk block addresses.
  334.  * This maps file system blocks to device size blocks.
  335.  */
  336. #define fsbtodb(fs, b)    ((b) << (fs)->fs_fsbtodb)
  337. #define    dbtofsb(fs, b)    ((b) >> (fs)->fs_fsbtodb)
  338.  
  339. /*
  340.  * Cylinder group macros to locate things in cylinder groups.
  341.  * They calc file system addresses of cylinder group data structures.
  342.  */
  343. #define    cgbase(fs, c)    ((daddr_t)((fs)->fs_fpg * (c)))
  344. #define cgstart(fs, c) \
  345.     (cgbase(fs, c) + (fs)->fs_cgoffset * ((c) & ~((fs)->fs_cgmask)))
  346. #define    cgsblock(fs, c)    (cgstart(fs, c) + (fs)->fs_sblkno)    /* super blk */
  347. #define    cgtod(fs, c)    (cgstart(fs, c) + (fs)->fs_cblkno)    /* cg block */
  348. #define    cgimin(fs, c)    (cgstart(fs, c) + (fs)->fs_iblkno)    /* inode blk */
  349. #define    cgdmin(fs, c)    (cgstart(fs, c) + (fs)->fs_dblkno)    /* 1st data */
  350.  
  351. /*
  352.  * Macros for handling inode numbers:
  353.  *     inode number to file system block offset.
  354.  *     inode number to cylinder group number.
  355.  *     inode number to file system block address.
  356.  */
  357. #define    itoo(fs, x)    ((x) % INOPB(fs))
  358. #define    itog(fs, x)    ((x) / (fs)->fs_ipg)
  359. #define    itod(fs, x) \
  360.     ((daddr_t)(cgimin(fs, itog(fs, x)) + \
  361.     (blkstofrags((fs), (((x) % (fs)->fs_ipg) / INOPB(fs))))))
  362.  
  363. /*
  364.  * Give cylinder group number for a file system block.
  365.  * Give cylinder group block number for a file system block.
  366.  */
  367. #define    dtog(fs, d)    ((d) / (fs)->fs_fpg)
  368. #define    dtogd(fs, d)    ((d) % (fs)->fs_fpg)
  369.  
  370. /*
  371.  * Extract the bits for a block from a map.
  372.  * Compute the cylinder and rotational position of a cyl block addr.
  373.  */
  374. #define blkmap(fs, map, loc) \
  375.     (((map)[(loc) / NBBY] >> ((loc) % NBBY)) & (0xff >> (NBBY - (fs)->fs_frag)))
  376. #define cbtocylno(fs, bno) \
  377.     ((bno) * NSPF(fs) / (fs)->fs_spc)
  378. #define cbtorpos(fs, bno) \
  379.     ((bno) * NSPF(fs) % (fs)->fs_spc % (fs)->fs_nsect * NRPOS / (fs)->fs_nsect)
  380.  
  381. /*
  382.  * The following macros optimize certain frequently calculated
  383.  * quantities by using shifts and masks in place of divisions
  384.  * modulos and multiplications.
  385.  */
  386. #define blkoff(fs, loc)        /* calculates (loc % fs->fs_bsize) */ \
  387.     ((loc) & ~(fs)->fs_bmask)
  388. #define fragoff(fs, loc)    /* calculates (loc % fs->fs_fsize) */ \
  389.     ((loc) & ~(fs)->fs_fmask)
  390. #define lblkno(fs, loc)        /* calculates (loc / fs->fs_bsize) */ \
  391.     ((loc) >> (fs)->fs_bshift)
  392. #define numfrags(fs, loc)    /* calculates (loc / fs->fs_fsize) */ \
  393.     ((loc) >> (fs)->fs_fshift)
  394. #define blkroundup(fs, size)    /* calculates roundup(size, fs->fs_bsize) */ \
  395.     (((size) + (fs)->fs_bsize - 1) & (fs)->fs_bmask)
  396. #define fragroundup(fs, size)    /* calculates roundup(size, fs->fs_fsize) */ \
  397.     (((size) + (fs)->fs_fsize - 1) & (fs)->fs_fmask)
  398. #define fragstoblks(fs, frags)    /* calculates (frags / fs->fs_frag) */ \
  399.     ((frags) >> (fs)->fs_fragshift)
  400. #define blkstofrags(fs, blks)    /* calculates (blks * fs->fs_frag) */ \
  401.     ((blks) << (fs)->fs_fragshift)
  402. #define fragnum(fs, fsb)    /* calculates (fsb % fs->fs_frag) */ \
  403.     ((fsb) & ((fs)->fs_frag - 1))
  404. #define blknum(fs, fsb)        /* calculates rounddown(fsb, fs->fs_frag) */ \
  405.     ((fsb) &~ ((fs)->fs_frag - 1))
  406.  
  407. /* BEGIN CS_RPAUSE */
  408. /* 
  409.  *  Low fragment/inode space flag bits.
  410.  */
  411. #define    FS_FNOSPC    1        /* low on fragments */
  412. #define    FS_INOSPC    2        /* low on inodes */
  413.  
  414. /* 
  415.  *  Free fragment/inode high/low water mark definitions.
  416.  */
  417. #define    FS_FLOWAT(fs)    ((fs)->fs_flowat)    /* fragment low water */
  418. #define    FS_FHIWAT(fs)    ((fs)->fs_fhiwat)    /* fragment high water */
  419. #define    FS_ILOWAT(fs)    ((fs)->fs_ilowat)    /* inode low water */
  420. #define    FS_IHIWAT(fs)    ((fs)->fs_ihiwat)    /* inode high water */
  421.  
  422. /* 
  423.  * Determine the absolute number of available inodes
  424.  */
  425. #define freeinodes(fs)                    \
  426. (                            \
  427.     ((fs)->fs_cstotal.cs_nifree)            \
  428. )
  429. /* 
  430.  * Determine the absolute number of available frags.
  431.  */
  432. #define freefrags(fs)                    \
  433. (                            \
  434.       blkstofrags((fs), (fs)->fs_cstotal.cs_nbfree)    \
  435.       +                            \
  436.       (fs)->fs_cstotal.cs_nffree            \
  437. )
  438. /* END CS_RPAUSE */
  439. /*
  440.  * Determine the number of available frags given a
  441.  * percentage to hold in reserve
  442.  */
  443. #define freespace(fs, percentreserved) \
  444.     (blkstofrags((fs), (fs)->fs_cstotal.cs_nbfree) + \
  445.     (fs)->fs_cstotal.cs_nffree - ((fs)->fs_dsize * (percentreserved) / 100))
  446.  
  447. /*
  448.  * Determining the size of a file block in the file system.
  449.  */
  450. #define blksize(fs, ip, lbn) \
  451.     (((lbn) >= NDADDR || (ip)->i_size >= ((lbn) + 1) << (fs)->fs_bshift) \
  452.         ? (fs)->fs_bsize \
  453.         : (fragroundup(fs, blkoff(fs, (ip)->i_size))))
  454. #define dblksize(fs, dip, lbn) \
  455.     (((lbn) >= NDADDR || (dip)->di_size >= ((lbn) + 1) << (fs)->fs_bshift) \
  456.         ? (fs)->fs_bsize \
  457.         : (fragroundup(fs, blkoff(fs, (dip)->di_size))))
  458.  
  459. /*
  460.  * Number of disk sectors per block; assumes DEV_BSIZE byte sector size.
  461.  */
  462. #define    NSPB(fs)    ((fs)->fs_nspf << (fs)->fs_fragshift)
  463. #define    NSPF(fs)    ((fs)->fs_nspf)
  464.  
  465. /*
  466.  * INOPB is the number of inodes in a secondary storage block.
  467.  */
  468. #define    INOPB(fs)    ((fs)->fs_inopb)
  469. #define    INOPF(fs)    ((fs)->fs_inopb >> (fs)->fs_fragshift)
  470.  
  471. /*
  472.  * NINDIR is the number of indirects in a file system block.
  473.  */
  474. #define    NINDIR(fs)    ((fs)->fs_nindir)
  475.  
  476.  
  477. #if    NeXT
  478. /*
  479.  * This macro controls whether the file system format is byte swapped or not.
  480.  * At NeXT, all little endian machines read and write big endian file systems.
  481.  */
  482. #define    BIG_ENDIAN_FS    (__LITTLE_ENDIAN__)
  483. #endif    NeXT
  484.